package com.cz.video.website.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.cz.video.common.core.validate.AddGroup;
import com.cz.video.common.core.validate.EditGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Null;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * <p>
 * 关注表
 * </p>
 *
 * @author 陈智
 * @since 2023-08-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(title="关注对象", description="关注表")
public class WebsiteFollow {


    @Schema(title = "ID")
    @Null(groups = AddGroup.class)
    @TableId("id")
    private Long id;

    @Schema(title = "粉丝id",description = "发起方")
    private Long followerId;

    @Schema(title = "被关注者id",description = "目标方")
    private Long followingId;

    @Schema(title = "关注类型",description = "(0:关注,1:拉黑)")
    @Pattern(regexp = "^([01])$", message = "type字段值不合法",groups = {AddGroup.class, EditGroup.class})
    private Integer type;

    @JsonIgnore
    @TableLogic
    private String delFlag;

    @Schema(title = "创建时间")
    @Null(groups = AddGroup.class)
    private Date createTime;

    @Schema(title = "创建人")
    @Null(groups = AddGroup.class)
    private String createBy;
}
